home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / cucd / programming / oberonv4 / source / system / amigaconsole.mod (.txt) < prev    next >
Oberon Text  |  1996-06-02  |  3KB  |  98 lines

  1. Syntax10.Scn.Fnt
  2. Syntax10i.Scn.Fnt
  3. Syntax14b.Scn.Fnt
  4. Syntax10b.Scn.Fnt
  5. MODULE AmigaConsole;    (* updated OJ 30 Apr 96 *)
  6. (* Port and IOReq are not properly set, so don't send messages to this device! *)
  7. IMPORT
  8.     SYSTEM, E := AmigaExec;
  9.     consoleBase*: E.DevicePtr;
  10.     iOStdReq: E.IOStdReq;
  11.     termEntry : E.TermEntry;
  12. CONST
  13.   consoleName * = "console.device";
  14. (****** SGR parameters ******)
  15.   primary     * = 0;
  16.   bold        * = 1;
  17.   italic      * = 3;
  18.   underscore  * = 4;
  19.   negative    * = 7;
  20.   normal        * = 22;      (* default foreground color, not bold *)
  21.   notItalic     * = 23;
  22.   notUnderscore * = 24;
  23.   positive      * = 27;
  24. (* these names refer to the ANSI standard, not the implementation *)
  25.   blank       * = 30;
  26.   red         * = 31;
  27.   green       * = 32;
  28.   yellow      * = 33;
  29.   blue        * = 34;
  30.   magenta     * = 35;
  31.   cyan        * = 36;
  32.   white       * = 37;
  33.   default     * = 39;
  34.   blackBg     * = 40;
  35.   redBg       * = 41;
  36.   greenBg     * = 42;
  37.   yellowBg    * = 43;
  38.   blueBg      * = 44;
  39.   magentaBg   * = 45;
  40.   cyanBg      * = 46;
  41.   whiteBg     * = 47;
  42.   defaultBg   * = 49;
  43. (* these names refer to the implementation, they are the preferred *)
  44. (* names for use with the Amiga console device. *)
  45.   clr0        * = 30;
  46.   clr1        * = 31;
  47.   clr2        * = 32;
  48.   clr3        * = 33;
  49.   clr4        * = 34;
  50.   clr5        * = 35;
  51.   clr6        * = 36;
  52.   clr7        * = 37;
  53.   clr0Bg      * = 40;
  54.   clr1Bg      * = 41;
  55.   clr2Bg      * = 42;
  56.   clr3Bg      * = 43;
  57.   clr4Bg      * = 44;
  58.   clr5Bg      * = 45;
  59.   clr6Bg      * = 46;
  60.   clr7Bg      * = 47;
  61. (****** DSR parameters ******)
  62.   dsrCpr      * = 6;
  63. (****** CTC parameters ******)
  64.   ctcHSetTab     * = 0;
  65.   ctcHClrTab     * = 2;
  66.   ctcHClrTabsAll * = 5;
  67. (****** TBC parameters ******)
  68.   tbcHClrTab     * = 0;
  69.   tbcHClrTabsAll * = 3;
  70. (****** SM and RM parameters ******)
  71.   mLNM   * = 20;      (* linefeed newline mode *)
  72.   mASM   * = ">1";    (* auto scroll mode *)
  73.   mAWM   * = "?7";    (* auto wrap mode *)
  74. PROCEDURE -ReturnD0    04EH,05EH,  04EH,075H;
  75. PROCEDURE RawKeyConvert*(events: LONGINT; VAR buffer: ARRAY OF SYSTEM.BYTE;
  76.             length: LONGINT; keyMap: LONGINT) : LONGINT;
  77. BEGIN
  78.     SYSTEM.PUTREG( 9, SYSTEM.ADR(buffer) );
  79.     SYSTEM.PUTREG( 8, events );
  80.     SYSTEM.PUTREG( 1, length );
  81.     SYSTEM.PUTREG( 10, keyMap );
  82.     SYSTEM.CALL( -48, consoleBase );
  83.     ReturnD0
  84. END RawKeyConvert;
  85. PROCEDURE Init;
  86. BEGIN
  87.     IF E.OpenDevice(consoleName, -1, SYSTEM.ADR(iOStdReq), {}) # 0 THEN HALT(99) END;
  88.     consoleBase := iOStdReq.device
  89. END Init;
  90. PROCEDURE Term;
  91. BEGIN
  92.     E.CloseDevice( SYSTEM.ADR(iOStdReq) )
  93. END Term;
  94. BEGIN
  95.     Init;
  96.     E.Register(termEntry, Term);
  97. END AmigaConsole.
  98.